import BtUi from 'bontal-base-ui';
const { util, cacheUtil, axios, post, get, postFile,regetToken} = BtUi.BtUtils
import url_mapper from 'src/store/tranUrlMapping.json';
import url_string from 'src/constant/url-string.js';

util.updateUrl && util.updateUrl(url_mapper, url_string);
util.getServiceName = function (transCode) {
  const serviceMap = {
    "clmlaw": "law-service",
    "base": "base-service",
    "cauto": "cauto-service",
    // "chat": "chat-service",
    "chtac": "chtac-service",
    "cprop": "cprop-service",
    "doc": "doc-service",
    "dspt": "auto-dspt-service",
    "img": "img-service",
    "in": "inter-service",
    "msgplat": "msg-plat-service",
    "ndc": "ndc-service",
    "party": "party-service",
    "pay": "pay-service",
    "prod": "prod-service",
    "rls": "rls-service",
    "rp": "rp-service",
    "ri": "ri-service",
    "uauto": "uauto-service",
    "uagri": "uagri-service",
    "slvg": "slvg-service",
    "uc": "uc-service",
    "uhtac": "uhtac-service",
    "uprop": "uprop-service",
    "uplcy": "uprop-service",
    "udr": "uprop-service",
    "um": "um-zx-service",
    "vr": "vreport-service",
    "vrs": "vreport-service"
  };
  let code = transCode.toLowerCase();

  for (let key in serviceMap) {
    if (code.match(key)) {
      console.log('transCode::: ', code, serviceMap[key])
      return serviceMap[key];
    }
  }
}
export {
    util,
    cacheUtil,
    axios,
    post,
    get,
    postFile,
		regetToken
};